package com.bwie.config;

import org.apache.kafka.clients.admin.NewTopic;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 军哥
 * @version 1.0
 * @description: TODO
 * @date 2025/3/27 15:25
 */

@Configuration
public class KafkaConfig {

    public static final String TOPIC_TEST = "topic-test";
    public static final String TOPIC_LOG = "topic-log";

    /**
     * @description 创建测试主题
     * @params []
     * @return org.apache.kafka.clients.admin.NewTopic
     * @author 军哥
     * @date 2025/3/27 15:27
     */
    @Bean
    public NewTopic testTopic() {
        return new NewTopic(TOPIC_TEST, 1, (short) 1);
    }

    @Bean
    public NewTopic logTopic() {
        return new NewTopic(TOPIC_LOG, 1, (short) 1);
    }

}
